home *** CD-ROM | disk | FTP | other *** search
- /*
- ------------------------------------------------------------------------------
- | Sun Microsystems, TOPS Division
- | 950 Marina Village Parkway
- | P.O. Box 4016
- | Alameda, CA 94501
- |
- | Copyright (c) 1989 Sun Microsystems, Inc. All rights reserved.
- |
- | Sun considers its source code as an unpublished, proprietary trade secret,
- | and it is available only under strict license provisions. This copyright
- | notice is placed here only to protect Sun in the event the source is deemed
- | a published work. Disassembly, decompilation, or other means of reducing the
- | object code to human readable form is prohibited by the license agreement
- | under which this code is provided to the user or company in possession of
- | this copy.
- |
- | RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the Government
- | is subject to restrictions as set forth in subparagraph (c) (1) (ii) of the
- | Rights in Technical Data and Computer Software clause at DFARS 52.227-7013
- | and in similar clauses in the FAR and NASA FAR supplement.
- ------------------------------------------------------------------------------
- */
-
-
-
- /*
-
- INTERFACE CApplication
-
- */
-
- #ifndef __CApplication__
- #define __CApplication__
-
-
- #include "StdHdr.h"
- #include "CObject.h"
- #include <EventMgr.h>
-
-
- /*** CONSTANTS ***/
-
- /* menu ids */
- #define mApple 1
- #define iAbout 1
-
- #define mFile 2
-
- #define mEdit 3
-
-
- /* cmd numbers */
- #define cNoCmd 0
- #define cAbout 1
- #define cOpenDA 2
-
- #define cQuit 10
- #define cNew 11
- #define cOpen 12
-
- #define kSFTop 50
- #define kSFLeft 50
-
- #define kAboutAlertID 201
-
-
-
- void InitToolbox(INT16 callsToMoreMasters);
-
- struct CApplication:CObject {
-
- Boolean fDone;
- OSType fMainFileType;
- Boolean fWNE;
-
- /* initialization */
- void IApplication(OSType itsMainFileType);
- void CreateMenus(void);
- void MainEventLoop(void);
-
- /* event dispatching */
- void HandleEvent(EventRecord* e);
- void DoUpdate(EventRecord* e);
- void DoActivate(EventRecord* e);
- void DoKeyDown(EventRecord* e);
- void DoMouseDown(EventRecord* e);
- void DoMouseMoved(EventRecord* e);
- void DoResume(EventRecord* e);
- void DoSuspend(EventRecord* e);
- void DoIdle(EventRecord* e);
-
- /* menu handling */
- void HandleMenuSelection(INT32 theSelection);
- INT16 MenuSelectionToCmd(INT16 menu, INT16 item);
- void DoMenuCmd(INT16 cmd);
-
- /* cmd number methods */
- void DoAbout(void);
- void OpenDA(INT16 whichOne);
- void Quit(void);
- void OpenNew(void);
- void OpenOld(void);
- void OpenFile(OSType fType, INT16 vRefNum, Str255 fName);
- };
-
-
- #endif
-